package thread;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

public class MyTimer {
    public static void main(String[] args) throws ParseException {
//        System.out.println(new Date());
        DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String da = "2021-4-7 00:00:00";
//        System.currentTimeMillis();
        Date date = format.parse(da);
        Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println(11);
                timer.cancel();
            }
        }, 1100);

    }
}
